@use "styles/IconSizes.module.scss";
@use "styles/Radius.module.scss";
@use "styles/Spacings.module.scss";
@use "styles/Typography.module.scss";
@use "styles/ZIndexes.module.scss";

.single_selector_wrapper {
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--background-0);
  font-size: Typography.$small;

  .first_line_wrapper {
    display: flex;
    justify-content: space-between;
    border: 1px solid var(--border-2);
    border-radius: Radius.$normal;
    align-items: center;
    cursor: pointer;
    display: flex;

    &.unfolded {
      border-radius: Radius.$normal Radius.$normal 0 0;
    }

    .left {
      display: flex;
      align-items: center;
      gap: Spacings.$spacing03;
      padding-block: Spacings.$spacing02;
      padding-inline: Spacings.$spacing03;
      overflow: hidden;

      .icon {
        width: IconSizes.$normal;
      }

      .label {
        overflow: hidden;
        background-color: var(--background-primary-1);
        border-radius: Radius.$normal;
        padding-inline: Spacings.$spacing05;
        padding-block: Spacings.$spacing01;
        white-space: nowrap;
        font-size: Typography.$small;
        height: 24px;
        display: flex;
        align-items: center;

        .label_text {
          @include Typography.EllipsisOverflow;
        }

        &.not_set {
          color: var(--text-1);
          background-color: transparent;
          padding-inline: 0;
        }

        &.unfolded_not_set {
          width: 0;
        }
      }
    }

    .right {
      flex: 1;
      font-size: Typography.$small;
      padding-block: Spacings.$spacing02;
      min-width: 50%;

      &.folded {
        display: none;
      }
    }
  }

  .options {
    position: absolute;
    background-color: var(--background-0);
    width: 100%;
    top: 100%;
    border: 1px solid var(--border-2);
    border-top: none;
    border-radius: 0 0 Radius.$normal Radius.$normal;
    overflow: hidden;
    max-height: 180px;
    overflow: scroll;
    z-index: ZIndexes.$overlay;
    padding-block: Spacings.$spacing02;

    .option {
      padding-inline: Spacings.$spacing03;
      padding-block: Spacings.$spacing02;
      cursor: pointer;
      display: flex;
      gap: Spacings.$spacing03;
      align-items: center;
      overflow: hidden;

      &:hover {
        .option_name {
          background-color: var(--background-primary-1);
        }
      }

      .icon {
        width: IconSizes.$normal;
      }

      .option_name {
        @include Typography.EllipsisOverflow;
        border: 1px solid var(--border-1);
        border-radius: Radius.$normal;
        padding-inline: Spacings.$spacing05;
        padding-block: Spacings.$spacing01;
        white-space: nowrap;
      }
    }
  }
}
